using System.ComponentModel;

namespace AdminApiTemplate.Common.Attributes
{
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
    public class AddIfAttribute : Attribute
    {
        public string Field { get; set; }

        public AddIfFieldTypeEnum FieldType { get; set; }

        public AddIfOperationTypeEnum OperationType { get; set; }

        public bool AddDays { get; set; }
    }

    public enum AddIfOperationTypeEnum
    {
        /// <summary>
        /// 等于
        /// </summary>
        [Description("等于")]
        Equal = 0,

        /// <summary>
        /// 不等于
        /// </summary>
        [Description("不等于")]
        NotEqual = 1,

        /// <summary>
        /// 相似
        /// </summary>
        [Description("相似")]
        Like = 2,

        /// <summary>
        /// 左相似
        /// </summary>
        [Description("左相似")]
        LeftLike = 3,

        /// <summary>
        /// 右相似
        /// </summary>
        [Description("右相似")]
        RightLike = 4,

        /// <summary>
        /// 小于
        /// </summary>
        [Description("小于")]
        Greater = 5,

        /// <summary>
        /// 小于等于
        /// </summary>
        [Description("小于等于")]
        GreaterEqual = 6,

        /// <summary>
        /// 大于
        /// </summary>
        [Description("大于")]
        Less = 7,

        /// <summary>
        /// 大于等于
        /// </summary>
        [Description("大于等于")]
        LessEqual = 8,

        /// <summary>
        /// 范围
        /// </summary>
        [Description("范围")]
        Range = 9,

        /// <summary>
        /// 包含
        /// </summary>
        [Description("包含")]
        In = 10,
        /// <summary>
        /// 格式
        /// </summary>
        [Description("格式")]
        SqlFormat = 11
    }

    public enum AddIfFieldTypeEnum
    {
        /// <summary>
        /// Int32
        /// </summary>
        [Description("Int32")]
        Int32 = 0,

        /// <summary>
        /// Int64
        /// </summary>
        [Description("Int64")]
        Int64 = 1,

        /// <summary>
        /// Decimal
        /// </summary>
        [Description("Decimal")]
        Decimal = 2,

        /// <summary>
        /// DateTime
        /// </summary>
        [Description("DateTime")]
        DateTime = 3,

        /// <summary>
        /// Boolean
        /// </summary>
        [Description("Boolean")]
        Boolean = 4,
    }
}
